<?php 
	include("../includes/connection.php");
	$id = $_POST['id'];
	$sql_select = "SELECT * FROM tb_portfolio_image WHERE id = '$id'";
	$query_select = mysql_query($sql_select);
	$result_select = mysql_fetch_array($query_select);
	unlink("../img/portfolio/".$result_select["code"]."/".$result_select["gambar"]);
	unlink("../img/portfolio/".$result_select["code"]."/thumbnail/".$result_select["gambar"]);

	$sql = "DELETE FROM tb_portfolio_image WHERE id = '$id'";
	$query = mysql_query($sql);
?>